package com.example.product.client;

import com.imooc.product.common.DecreaseStockInput;
import com.imooc.product.common.ProductInfoOutput;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @description:
 * @author: sanjin
 * @date: 2019/6/13 14:13
 */
@FeignClient(name = "product") // name参数指定服务名称
public interface ProductClient {

    @GetMapping("/product/list")
    String getProductList();

    @PostMapping("/product/listForOrder")
    List<ProductInfoOutput> getProductList(@RequestBody List<String> productIdList);

    @PostMapping("/product/decreaseStock")
    void decreaseStock(@RequestBody List<DecreaseStockInput> decreaseStockInputList);
}
